package cate.game.activity.config;

import cate.common.table.activity.IActivityOpen;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("活动开启基础配置")
public final class ActivityBaseCfg {

	@NoteField("类型")
	public byte type;

	@NoteField(value = "活动ID",detail = "配置在活动基础表中的id 用于区分不同期的活动 充值项中的subFuncId需要与这个id一致")
	public int activityId;

	@NoteField("功能ID")
	public int funcId;

	@NoteField("配置ID")
	public int configTid;

	@NoteField(value = "开始时间")
	public long startTime;

	@NoteField(value = "结束时间")
	public long endTime;

	public void init(IActivityOpen openRow) {
		type = openRow.getType();
		activityId = openRow.getActivityId();
		funcId = openRow.getFuncId();
		configTid = openRow.getConfigId();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		ActivityBaseCfg other = (ActivityBaseCfg) obj;
		return this.type == other.type && activityId == other.activityId && funcId == other.funcId && configTid == other.configTid;
	}
}
